{% extends "director/index.html" %}
{% load static %}
{% load jsonify %}

{% block page_content %}

<script type="text/javascript">


    //	heads=
    //	row =
    //
    //
    	can_add= true
    	can_log=true
    	can_del=true
    form_logic={
        el:'#there',
//			data:{
//				kw:{
//					heads:heads,
//			        row:row,
//			   		errors:{},
//				},
//				menu:menu,
//				can_add:can_add,
//				can_del:can_del,
//				can_log:can_log,
//			},
        data:{
            row:row,
            heads:heads,
        },
        mixins:[field_fun],
        methods:{
            get_head:function(name){
                return ex.findone(this.heads,{name:name})
            },
            save:function(){
                var self=this
                show_upload()
                var post_data=[{fun:'save_group_permit',row:this.row}]
                ex.post('/d/ajax',JSON.stringify(post_data),function(resp){
                    hide_upload(200)
                    self.after_sub()
                })
            },
            submit_return:function(){
                this.save()
            }
        }

    }

    $(function () {
        new Vue(form_logic)
    })
</script>

{% block extra_head %}

{% endblock %}

<div id='there'>

    <div v-if="can_log" style='float: right;padding: 5px 20px;'>
        <a :href="log_url()">History</a>
    </div>
    <path-nav :menu='menu'>
        <li><span>编辑</span></li>
    </path-nav>

    <com-form-btn :submit="save" :del_row="del_row" :cancel="cancel" :form_bus="this"></com-form-btn>
    <!--<div style='overflow: hidden;'>-->
    <!--<div class="btn-group" style='float: right;'>-->
    <!--<button type="button" class="btn btn-default" @click='submit()' v-if='can_add'>Save</button>-->
    <!--<button type="button" class="btn btn-default" v-if='can_del' @click='del_row()'>删除</button>-->
    <!--<button type="button" class="btn btn-default" @click='cancel()' >Cancel</button>-->
    <!--</div>-->
    <!--</div>-->


    <div class='field-panel'>

        <field  v-for='head in heads' :key="head.name" :row="row" :head='head'></field>
    </div>
</div>

<style>
    ._tow-col-sel{
        height: 30em;
    }
</style>
{% endblock %}